import request from '@/utils/request'

// 获取列表
export function GetListAPI(params) {
  return request({
    url: '/scheduling/productionSchedule/list',
    method: 'GET',
    params
  })
}

// 手动下达查询
export function GetManualAPI(data) {
  return request({
    url: '/scheduling/productionSchedule/' + data,
    method: 'GET'
  })
}

// 根据线别和物料编码 返回开工时间
export function GetStartWorkAPI(params) {
  return request({
    url: '/scheduling/productionSchedule/startWork',
    method: 'GET',
    params
  })
}

// 根据排产重量and订单幅宽and分切数量返回预计工时and完工时间
export function GetFinishWorkAPI(params) {
  return request({
    url: '/scheduling/productionSchedule/finishWork',
    method: 'GET',
    params
  })
}

// 手动下达 提交
export function ManualDataAPI(data) {
  return request({
    url: '/scheduling/productionSchedule/manual',
    method: 'POST',
    data
  })
}

// 查询生产排程(下达后)
export function GetListGiveAPI(params) {
  return request({
    url: '/scheduling/productionSchedule/listGive',
    method: 'GET',
    params
  })
}

// 排程确认
export function ConfirmAPI(data) {
  return request({
    url: '/scheduling/productionSchedule/confirm',
    method: 'PUT',
    data
  })
}

// 排程确认
export function DelProductionScheduleAPI(data) {
  return request({
    url: '/scheduling/productionSchedule/' + data,
    method: 'DELETE'
  })
}

// T+N
export function TNAPI(data) {
  return request({
    url: '/scheduling/productionSchedule/lock',
    method: 'POST',
    data
  })
}

// 自动下达 之前返回数据
export function GetCombinedAPI(params) {
  return request({
    url: '/scheduling/productionSchedule/combined/' + params,
    method: 'GET'
  })
}

// 自动下达 提交
export function ConsolidatedDataAPI(data) {
  return request({
    url: '/scheduling/productionSchedule/combinedThe',
    method: 'POST',
    data
  })
}

// 自动下达 提交
export function getCutShopModelingAPI() {
  return request({
    url: 'system/modeling/getCutShopModeling',
    method: 'GET'
  })
}

// 根据物料编码和重量 查询所需要物料列表
// export function getMaterialRatioAPI(params) {
//   return request({
//     url: '/scheduling/productionSchedule/materialRatio',
//     method: 'GET',
//     params
//   })
// }

// 根据物料编码和重量 查询所需要物料列表
export function getMaterialRatioAPI(params) {
  return request({
    url: '/scheduling/productionSchedule/queryBom',
    method: 'GET',
    params
  })
}
